﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.pbcattblMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>pbcattbl</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = pbcattbl_MainStore.getAt(index).get('pbt_tnam');
            
			TxtNumpbt_tid.setValue(pbcattbl_MainStore.getAt(index).get('pbt_tid'));
			Txtpbt_ownr.setValue(pbcattbl_MainStore.getAt(index).get('pbt_ownr'));
			Txtpbd_fhgt.setValue(pbcattbl_MainStore.getAt(index).get('pbd_fhgt'));
			Txtpbd_fwgt.setValue(pbcattbl_MainStore.getAt(index).get('pbd_fwgt'));
			Txtpbd_fitl.setValue(pbcattbl_MainStore.getAt(index).get('pbd_fitl'));
			Txtpbd_funl.setValue(pbcattbl_MainStore.getAt(index).get('pbd_funl'));
			Txtpbd_fchr.setValue(pbcattbl_MainStore.getAt(index).get('pbd_fchr'));
			Txtpbd_fptc.setValue(pbcattbl_MainStore.getAt(index).get('pbd_fptc'));
			Txtpbd_ffce.setValue(pbcattbl_MainStore.getAt(index).get('pbd_ffce'));
			Txtpbh_fhgt.setValue(pbcattbl_MainStore.getAt(index).get('pbh_fhgt'));
			Txtpbh_fwgt.setValue(pbcattbl_MainStore.getAt(index).get('pbh_fwgt'));
			Txtpbh_fitl.setValue(pbcattbl_MainStore.getAt(index).get('pbh_fitl'));
			Txtpbh_funl.setValue(pbcattbl_MainStore.getAt(index).get('pbh_funl'));
			Txtpbh_fchr.setValue(pbcattbl_MainStore.getAt(index).get('pbh_fchr'));
			Txtpbh_fptc.setValue(pbcattbl_MainStore.getAt(index).get('pbh_fptc'));
			Txtpbh_ffce.setValue(pbcattbl_MainStore.getAt(index).get('pbh_ffce'));
			Txtpbl_fhgt.setValue(pbcattbl_MainStore.getAt(index).get('pbl_fhgt'));
			Txtpbl_fwgt.setValue(pbcattbl_MainStore.getAt(index).get('pbl_fwgt'));
			Txtpbl_fitl.setValue(pbcattbl_MainStore.getAt(index).get('pbl_fitl'));
			Txtpbl_funl.setValue(pbcattbl_MainStore.getAt(index).get('pbl_funl'));
			Txtpbl_fchr.setValue(pbcattbl_MainStore.getAt(index).get('pbl_fchr'));
			Txtpbl_fptc.setValue(pbcattbl_MainStore.getAt(index).get('pbl_fptc'));
			Txtpbl_ffce.setValue(pbcattbl_MainStore.getAt(index).get('pbl_ffce'));
			Txtpbt_cmnt.setValue(pbcattbl_MainStore.getAt(index).get('pbt_cmnt'));

            pbcattbl_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--pbcattbl表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="pbcattbl_MainStore" OnRefreshData="pbcattbl_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="pbt_tnam">
                <Fields>
                    
					<ext:RecordField Name="pbt_tnam" />
					<ext:RecordField Name="pbt_tid" />
					<ext:RecordField Name="pbt_ownr" />
					<ext:RecordField Name="pbd_fhgt" />
					<ext:RecordField Name="pbd_fwgt" />
					<ext:RecordField Name="pbd_fitl" />
					<ext:RecordField Name="pbd_funl" />
					<ext:RecordField Name="pbd_fchr" />
					<ext:RecordField Name="pbd_fptc" />
					<ext:RecordField Name="pbd_ffce" />
					<ext:RecordField Name="pbh_fhgt" />
					<ext:RecordField Name="pbh_fwgt" />
					<ext:RecordField Name="pbh_fitl" />
					<ext:RecordField Name="pbh_funl" />
					<ext:RecordField Name="pbh_fchr" />
					<ext:RecordField Name="pbh_fptc" />
					<ext:RecordField Name="pbh_ffce" />
					<ext:RecordField Name="pbl_fhgt" />
					<ext:RecordField Name="pbl_fwgt" />
					<ext:RecordField Name="pbl_fitl" />
					<ext:RecordField Name="pbl_funl" />
					<ext:RecordField Name="pbl_fchr" />
					<ext:RecordField Name="pbl_fptc" />
					<ext:RecordField Name="pbl_ffce" />
					<ext:RecordField Name="pbt_cmnt" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--pbcattbl页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="pbcattbl_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="pbcattbl_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{pbcattbl_MainForm}.getForm().reset();#{Hid}.setValue('');#{pbcattbl_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{pbcattbl_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{pbcattbl_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(pbcattbl_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="pbcattbl_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="pbt_tnam" />
                                
								<ext:Column Header="pbt_tid" Sortable="true" DataIndex="pbt_tid" />
								<ext:Column Header="pbt_ownr" Sortable="true" DataIndex="pbt_ownr" />
								<ext:Column Header="pbd_fhgt" Sortable="true" DataIndex="pbd_fhgt" />
								<ext:Column Header="pbd_fwgt" Sortable="true" DataIndex="pbd_fwgt" />
								<ext:Column Header="pbd_fitl" Sortable="true" DataIndex="pbd_fitl" />
								<ext:Column Header="pbd_funl" Sortable="true" DataIndex="pbd_funl" />
								<ext:Column Header="pbd_fchr" Sortable="true" DataIndex="pbd_fchr" />
								<ext:Column Header="pbd_fptc" Sortable="true" DataIndex="pbd_fptc" />
								<ext:Column Header="pbd_ffce" Sortable="true" DataIndex="pbd_ffce" />
								<ext:Column Header="pbh_fhgt" Sortable="true" DataIndex="pbh_fhgt" />
								<ext:Column Header="pbh_fwgt" Sortable="true" DataIndex="pbh_fwgt" />
								<ext:Column Header="pbh_fitl" Sortable="true" DataIndex="pbh_fitl" />
								<ext:Column Header="pbh_funl" Sortable="true" DataIndex="pbh_funl" />
								<ext:Column Header="pbh_fchr" Sortable="true" DataIndex="pbh_fchr" />
								<ext:Column Header="pbh_fptc" Sortable="true" DataIndex="pbh_fptc" />
								<ext:Column Header="pbh_ffce" Sortable="true" DataIndex="pbh_ffce" />
								<ext:Column Header="pbl_fhgt" Sortable="true" DataIndex="pbl_fhgt" />
								<ext:Column Header="pbl_fwgt" Sortable="true" DataIndex="pbl_fwgt" />
								<ext:Column Header="pbl_fitl" Sortable="true" DataIndex="pbl_fitl" />
								<ext:Column Header="pbl_funl" Sortable="true" DataIndex="pbl_funl" />
								<ext:Column Header="pbl_fchr" Sortable="true" DataIndex="pbl_fchr" />
								<ext:Column Header="pbl_fptc" Sortable="true" DataIndex="pbl_fptc" />
								<ext:Column Header="pbl_ffce" Sortable="true" DataIndex="pbl_ffce" />
								<ext:Column Header="pbt_cmnt" Sortable="true" DataIndex="pbt_cmnt" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="pbcattbl_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="pbt_ownr" />
								<ext:StringFilter DataIndex="pbd_fhgt" />
								<ext:StringFilter DataIndex="pbd_fwgt" />
								<ext:StringFilter DataIndex="pbd_fitl" />
								<ext:StringFilter DataIndex="pbd_funl" />
								<ext:StringFilter DataIndex="pbd_fchr" />
								<ext:StringFilter DataIndex="pbd_fptc" />
								<ext:StringFilter DataIndex="pbd_ffce" />
								<ext:StringFilter DataIndex="pbh_fhgt" />
								<ext:StringFilter DataIndex="pbh_fwgt" />
								<ext:StringFilter DataIndex="pbh_fitl" />
								<ext:StringFilter DataIndex="pbh_funl" />
								<ext:StringFilter DataIndex="pbh_fchr" />
								<ext:StringFilter DataIndex="pbh_fptc" />
								<ext:StringFilter DataIndex="pbh_ffce" />
								<ext:StringFilter DataIndex="pbl_fhgt" />
								<ext:StringFilter DataIndex="pbl_fwgt" />
								<ext:StringFilter DataIndex="pbl_fitl" />
								<ext:StringFilter DataIndex="pbl_funl" />
								<ext:StringFilter DataIndex="pbl_fchr" />
								<ext:StringFilter DataIndex="pbl_fptc" />
								<ext:StringFilter DataIndex="pbl_ffce" />
								<ext:StringFilter DataIndex="pbt_cmnt" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="pbcattbl_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--pbcattbl表修改，添加主窗体-->
    <ext:Window ID="pbcattbl_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="pbcattbl_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="390" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:NumberField ID="TxtNumpbt_tid" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbt_tid" />
							<ext:TextField ID="Txtpbd_fhgt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbd_fhgt" />
							<ext:TextField ID="Txtpbd_fitl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbd_fitl" />
							<ext:TextField ID="Txtpbd_fchr" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbd_fchr" />
							<ext:TextField ID="Txtpbd_ffce" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbd_ffce" />
							<ext:TextField ID="Txtpbh_fwgt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbh_fwgt" />
							<ext:TextField ID="Txtpbh_funl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbh_funl" />
							<ext:TextField ID="Txtpbh_fptc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbh_fptc" />
							<ext:TextField ID="Txtpbl_fhgt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbl_fhgt" />
							<ext:TextField ID="Txtpbl_fitl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbl_fitl" />
							<ext:TextField ID="Txtpbl_fchr" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbl_fchr" />
							<ext:TextField ID="Txtpbl_ffce" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbl_ffce" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtpbt_ownr" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbt_ownr" />
							<ext:TextField ID="Txtpbd_fwgt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbd_fwgt" />
							<ext:TextField ID="Txtpbd_funl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbd_funl" />
							<ext:TextField ID="Txtpbd_fptc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbd_fptc" />
							<ext:TextField ID="Txtpbh_fhgt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbh_fhgt" />
							<ext:TextField ID="Txtpbh_fitl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbh_fitl" />
							<ext:TextField ID="Txtpbh_fchr" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbh_fchr" />
							<ext:TextField ID="Txtpbh_ffce" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbh_ffce" />
							<ext:TextField ID="Txtpbl_fwgt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbl_fwgt" />
							<ext:TextField ID="Txtpbl_funl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbl_funl" />
							<ext:TextField ID="Txtpbl_fptc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbl_fptc" />
							<ext:TextField ID="Txtpbt_cmnt" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pbt_cmnt" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{pbcattbl_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{pbcattbl_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
